1. Field of the Invention
The present invention relates to an electronic comparator device, more specifically to a window comparator, used to determine a time interval in which an input signal varies between a first threshold voltage and a second threshold voltage. Moreover, the present invention relates to a window comparator for determining an inherent time constant (RC constant) of an analog integrated circuit, such as an analog electronic filter circuit.
2. Background of the Invention
In many electronic applications an input signal having an amplitude that varies in time needs to be compared with a predefined threshold voltage, wherein an electronic device provides an output signal to indicate whether the input signal is higher or lower than the threshold voltage. Typically, a common operational amplifier without negative feedback, or especially designed amplifiers, so-called analog comparators, are used to detect the point in time when a varying input signal exceeds the predefined threshold value.
Any conventional analog comparator (hereinafter simply referred to as comparator), however, exhibits offset and timing errors, when no additional offset calibration, pre-charging and/or sampling architecture is provided. The offset error of the comparator is primarily caused by a static input offset voltage and a variable offset voltage that depends on the applied input voltage and the threshold voltage supplied to the comparator. The timing error of the comparator, i.e., the delay between the point in time when the input signal actually crosses the threshold voltage and the point in time when a change of the comparator""s output finally indicates the crossover of the input signal and the threshold voltage, is caused by time delays of the electronic circuit, for example, by the rise and fall times of the output node(s) of the comparator, and a so-called meta-stability or hysteresis of the comparator that occurs for a small difference of the input signal and the threshold voltage. The range/time of the meta-stability also depends on the direction in which the input signal crosses the threshold voltage.
Comparators are frequently used in applications where an analog input signal is compared with a linearly varying threshold voltage to determine a time interval from a defined start value of the threshold voltage to the point in time when the threshold voltage equals the input signal. The time interval, for example determined by means of a counter that is triggered by the comparator output, may then be used as a digital measure for the analog signal, for instance in form of the counter value. Such a single slope measurement, however, will entrain a large conversion error due to the timing and offset errors described above. Accordingly, additional circuitry for obtaining precise results in a single slope measurement using a comparator is required, thereby contributing to circuit complexity and increasing of manufacturing cost.
An increased circuit complexity is even more disadvantageous when the comparator is a part of an analog integrated circuit that is additionally provided with the comparator circuitry for compensating for parameter variations of the analog integrated circuit. For example, in analog filter circuits the capacitances and the resistances may vary up to 50% due to tolerances in the manufacturing process and/or temperature variations during operation. To precisely adjust the current filter response to the desired design value, the actual RC time constant has to be determined by means of, for example, an on-chip comparator circuitry comparing a rising voltage with two threshold voltages (this type of comparator circuit is also referred to as a window comparator), so as to readjust the filter circuit to the required design value.
In view of the above problems, a need exists for an improved comparator circuit capable of performing a single slope measurement with high precision.
According to one embodiment, a comparator circuit for time-critical applications in which an amplitude of an input signal crosses a first threshold voltage and a second threshold voltage, comprises comparator means having a first input terminal receiving the input signal, a second input terminal and an output terminal. The comparator circuit further comprises switching means having a first switch input receiving the first threshold voltage, a second switch input receiving the second threshold voltage, a switch output connected to the second input terminal of the comparator means, and a switch control input, wherein the switching means connects the first switch input with the switch output upon receipt of a first control signal at the switch control input, and connects the second switch input with the switch output upon receipt of a second control signal at the switch control input. Moreover, the comparator circuit comprises control means having a reset input receiving a reset signal, a trigger input connected to the output terminal of the comparator means and a control output connected to the switch control input, wherein the control means supplies the first control signal to the switch control input upon receipt of the reset signal, and wherein the control means supplies the second control signal to the switch control input upon receipt of one of a rising edge and a falling edge of a signal at the trigger input that is provided by the output terminal of the comparator means.
According to a further embodiment method of determining a time interval in which an input signal changes its amplitude between a first threshold voltage and a second threshold voltage is provided. The method comprises supplying the input signal to a first input of a comparator, and supplying the first threshold voltage to a second input of the comparator, wherein the comparator changes its output state when the input signal crosses the first threshold voltage. The method also includes supplying, upon the changing of the output state of the comparator, the second threshold voltage to the second input of the comparator such that one of subsequent rising edges and falling edges of the comparator output represent said time interval.
Also contemplated is a comparator circuit having switchable threshold voltages to provide a window function of the comparator. The switch is controlled by a control means, such as a flip-flop, that is inserted as a xe2x80x9cdigital feedbackxe2x80x9d means between the comparator output and the switch control input. The control means is triggered by the output of the comparator when the input signal crosses the first threshold voltage to couple the second threshold voltage to the comparator. The comparator, correspondingly reset, can detect the point in time when the input voltage crosses the second threshold voltage with substantially the same rise or fall time. The second detection, i.e., the crossing of the second threshold voltage, sets the output of the comparator with substantially the same delay caused by the meta-stability of the comparator as in the previous detection of crossing the first threshold voltage. Since the delay for setting the comparator output is approximately the same for the first and second detection, the time interval is determined by two subsequent falling and rising edges, respectively, depending on the type of comparator used.
The comparator circuit in accordance with one embodiment may be particularly useful when determining a time interval required to charge a capacitor with a constant current in order to estimate the capacitance of the capacitor.
Moreover, the comparator circuit according to this embodiment may advantageously be employed in combination with a circuit having an inherent RC time constant to determine the RC time constant, which may be caused by tolerances during the fabrication and/or by variations of the environmental conditions during operation of the device, such as temperature, pressure, and/or humidity.